import { ref, reactive, onMounted, computed } from 'vue'
import { EditType } from '@/type/BaseEnum'
import useInstance from '@/hooks/useInstance'
import { useRouter } from 'vue-router'

import { OrderParm, OrderType } from '@/api/order/MangeModel'
import { orderStore } from '@/store/order'
export default function useAddress() {
	//新增弹框的ref属性
	const addRef = ref<{ show: (type?: string, row?: any) => void }>()
	const store = orderStore()
	const router = useRouter()
	//表格数据

	const listData = computed<OrderType>((): any => {
		return store.getorderItem
	})
	const getStatus = (n: {
		status: string | number
		status_type: number | string
	}) => {
		if (n.status == 1) {
			if (n.status_type == 0) {
				return '待发货'
			}
			if (n.status_type == 1) {
				return '已发货'
			}
			if (n.status_type == 2) {
				return '已提货'
			}
			if (n.status_type == 3) {
				return '已收货'
			}
			if (n.status_type == 4) {
				return '待提货'
			}

			return '已付款'
		}
		if (n.status == 0) {
			return '待支付'
		}
		if (n.status == 1) {
			return '已取消'
		}
		if (n.status == 90) {
			return '待退款'
		}

		if (n.status == 98) {
			return '已取消'
		}
		if (n.status == 99) {
			return '已退款'
		}
		if (n.status == 100) {
			return '拒绝退款'
		}
		status: 100
		status_type: 0
	}
	onMounted(() => {})
	return {
		listData,
		getStatus
	}
}
